var add = function (l1, l2) {
  let s1 = 0;
  for (let i in l1) {
    s1 = s1 + l1[i] * Math.pow(10, i);
  }
  let s2 = 0;
  for (let i in l2) {
    s2 = s2 + l2[i] * Math.pow(10, i);
  }
  let all = s1 + s2;
  let l3=[]
  while(all)
  {
    l3.push(Math.floor(all%10));
    all=Math.floor(all/10);
  }
  console.log(l3);
  
};
add([9,9,9,9,9,9,9], [9,9,9,9]);
